/*
 * @Author: DUST
 * @Date: 2023-05-28 15:31:18
 * @LastEditors: DUST
 * @LastEditTime: 2023-11-27 14:22:25
 * @FilePath: \business-card-system\server\app\router\login.ts
 * @Description: 
 * undefined
 */

import koaRouter from "koa-router";
import LoginController from "../controller/LoginController";
import AuthMiddleware from "../middleware/authMiddleqare";

const accountRouter = new koaRouter();

accountRouter.prefix("/login");

// 登录获取token
accountRouter.post("/token", LoginController.doLogin);
// 鉴权
accountRouter.use(AuthMiddleware);
accountRouter.post("/info/:id", LoginController.getUserInfo);
accountRouter.put("/change/password", LoginController.changePwd);


export default accountRouter;